Repository navigation
fix: keep the active tab visible when the header row overflows - #238
Merged
Merged
Conversation
therealsama
force-pushed
the
feat/mobile-touch-feel
branch
from
August 29, 2026 20:03
b04e134 to
bb8e7fe
Compare
therealsama
force-pushed
the
fix/header-active-tab-overflow
branch
from
August 29, 2026 20:14
053b9c3 to
bccdc1a
Compare
therealsama
force-pushed
the
feat/mobile-touch-feel
branch
from
September 1, 2026 23:12
bb8e7fe to
7026195
Compare
therealsama
force-pushed
the
fix/header-active-tab-overflow
branch
from
September 1, 2026 23:13
bccdc1a to
a1f196a
Compare
therealsama
force-pushed
the
feat/mobile-touch-feel
branch
from
September 2, 2026 04:22
7026195 to
f37041f
Compare
therealsama
force-pushed
the
fix/header-active-tab-overflow
branch
from
September 2, 2026 04:22
a1f196a to
156059a
Compare
therealsama
force-pushed
the
feat/mobile-touch-feel
branch
from
September 2, 2026 04:45
f37041f to
4d30236
Compare
therealsama
force-pushed
the
fix/header-active-tab-overflow
branch
from
September 2, 2026 04:47
156059a to
9868c4c
Compare
therealsama
force-pushed
the
fix/header-active-tab-overflow
branch
from
September 2, 2026 07:35
9868c4c to
41e35ea
Compare
therealsama
enabled auto-merge
September 5, 2026 11:22
kplachkov
approved these changes
Sep 5, 2026
The nav packer filled the row strictly left-to-right, so a 320px bar spent its only slot on Best whichever feed was open. Picking Ask from the More menu left the bar reading Best, with the active pill hidden inside the menu it had just been chosen from. An active contextual pill escaped this only because it already sits at index 0. usePackedNav now takes a pinned item that claims its slot before the pass, and Header pins the active tab. The row still reads in canonical order, and a pin too wide to fit alone is dropped rather than overflowing the row.
therealsama
force-pushed
the
fix/header-active-tab-overflow
branch
from
September 5, 2026 11:25
41e35ea to
84f2e56
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
On a narrow phone the header fits one pill plus More. Opening Ask, New or Show from that menu left the bar reading Best — the active pill was packed into the very menu it had been chosen from. From and User were unaffected.
/showBest | MoreShow | MoreWhy
usePackedNavfills the row strictly left-to-right and stops at the first pill that doesn't fit, andderiveHeaderStateemits feed tabs in fixedbest → show → ask → newestorder withisActiveas a flag the packer never reads. One slot therefore always went to Best.An active contextual pill (
comments/user/from) is pushed at index 0, which is why those two looked fine — they were surviving by position, not by being active.The fix
PackableItemgains an optionalpinned, claimed before the left-to-right pass;Headersetspinned: it.isActive.Promoting the active feed to the front would have been simpler and was rejected: fixed tab order is deliberate (
Header.test.tsxalready locks it), and reordering makes tabs jump as you move between feeds. So:Best New, notNew Best;visible/hiddenare filtered rather than sliced, because a pinned item can sit past the run that fits.Test plan
usePackedNav.test.ts: the one-slot case (the bug, at real pill widths), order preservation around a pin, the too-wide fallback, and the pin being inert when everything fits.Header.test.tsx: the active item is pinned on each feed and contextual route, and nothing is pinned on/. Asserted on the packer's input, since the packer is mocked there.e2e/header-overflow.spec.ts: at 320px with a real ResizeObserver, each of show/ask/new is a visiblearia-current="page"pill and not a menu item.domain filter page), re-run 4/4 clean.